<template>
  <view>
    <view v-for="(item, idx) in faqs" :key="idx" class="faq-item">
      <view class="q" @click="toggle(idx)">
        <text>{{item.q}}</text>
        <text>{{openIdx === idx ? '-' : '+'}}</text>
      </view>
      <view v-if="openIdx === idx" class="a">{{item.a}}</view>
    </view>
  </view>
</template>
<script>
export default {
  props: { faqs: Array },
  data() { return { openIdx: -1 } },
  methods: {
    toggle(idx) { this.openIdx = this.openIdx === idx ? -1 : idx }
  }
}
</script>
<style scoped>
.faq-item { border-bottom: 1px solid #eee; padding: 16rpx 0; }
.q { display: flex; justify-content: space-between; font-weight: bold; cursor: pointer; }
.a { color: #666; margin-top: 8rpx; }
</style> 